//
//  HBKViewController.m
//  HZLBaseKit
//
//  Created by EDY on 08/16/2021.
//  Copyright (c) 2021 EDY. All rights reserved.
//

#import "HBKViewController.h"
#import "UIColor+Hzl.h"
#import "UIView+Hzl.h"

@interface HBKViewController ()

@property (nonatomic, strong) UIView *topView;

@end

@implementation HBKViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor cyanColor];
    
    [self.view addSubview:self.topView];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    self.topView.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF" alpha:0.8];
    
    [UIView animateWithDuration:1.0 animations:^{
        self.topView.y = 280;
    }];
}

- (UIView*)topView
{
    if (!_topView)
    {
        _topView = [[UIView alloc] initWithFrame:CGRectMake(100, 80, self.view.frame.size.width - 200, 80)];
        _topView.backgroundColor = [UIColor redColor];
    }
    
    return _topView;
}

@end
